package chapter13;

public class Rectangle extends GeometricObject {
  private String name;
  private int age;

  public Rectangle() {
  }

  public Rectangle(String name, int age) {
    this.name = name;
    this.age = age;
  }

  /** Return width */
  public String getName() {
    return name;
  }

  /** Set a new width */
  public void setName(String name) {
    this.name = name;
  }

  /** Return height */
  public int getAge() { return age; }

  /** Set a new height */
  public void setHeight(double height) {
    this.height = height;
  }

  @Override /** Return area */
  public double getArea() {
    return width * height;
  }

  @Override /** Return perimeter */
  public double getPerimeter() {
    return 2 * (width + height);
  }
}
